import request from '@/utils/request'

export function sysOrgList(params) {
  return request({
    url: '/api/sysOrg/list',
    method: 'get',
    params
  })
}

export function ownExtOrgList(id) {
  return request({
    url: `/api/sysUser/ownExtOrgList/${id}`,
    method: 'get'
  })
}

export function orgTypeList(id) {
  return request({
    url: '/api/sysDictData/dataList/org_type',
    method: 'get'
  })
}

export function addOrg(data) {
  return request({
    url: '/api/sysOrg/add',
    method: 'post',
    data
  })
}

export function updateOrg(data) {
  return request({
    url: '/api/sysOrg/update',
    method: 'post',
    data
  })
}

export function deleteOrg(id) {
  return request({
    url: '/api/sysOrg/delete',
    method: 'post',
    data: { id }
  })
}
